package domain;
// Generated 26-jun-2009 19:31:47 by Hibernate Tools 3.2.1.GA


import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Messages generated by hbm2java
 */
@Entity
@Table(name="messages"
    ,catalog="domeco"
)
public class Messages  implements java.io.Serializable {


     private Integer idMess;
     private Mobileconsumption mobileconsumption;
     private long mobile;
     private Date startMess;
     private double cost;
     private Date dateMess;

    public Messages() {
    }

    public Messages(Mobileconsumption mobileconsumption, long mobile, Date startMess, double cost, Date dateMess) {
       this.mobileconsumption = mobileconsumption;
       this.mobile = mobile;
       this.startMess = startMess;
       this.cost = cost;
       this.dateMess = dateMess;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idMess", unique=true, nullable=false)
    public Integer getIdMess() {
        return this.idMess;
    }
    
    public void setIdMess(Integer idMess) {
        this.idMess = idMess;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="mobileConsFK", nullable=false)
    public Mobileconsumption getMobileconsumption() {
        return this.mobileconsumption;
    }
    
    public void setMobileconsumption(Mobileconsumption mobileconsumption) {
        this.mobileconsumption = mobileconsumption;
    }
    
    @Column(name="mobile", nullable=false)
    public long getMobile() {
        return this.mobile;
    }
    
    public void setMobile(long mobile) {
        this.mobile = mobile;
    }
    @Temporal(TemporalType.TIME)
    @Column(name="startMess", nullable=false, length=8)
    public Date getStartMess() {
        return this.startMess;
    }
    
    public void setStartMess(Date startMess) {
        this.startMess = startMess;
    }
    
    @Column(name="cost", nullable=false, precision=22, scale=0)
    public double getCost() {
        return this.cost;
    }
    
    public void setCost(double cost) {
        this.cost = cost;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="dateMess", nullable=false, length=10)
    public Date getDateMess() {
        return this.dateMess;
    }
    
    public void setDateMess(Date dateMess) {
        this.dateMess = dateMess;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMess != null ? idMess.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Messages)) {
            return false;
        }
        Messages other = (Messages) object;
        if ((this.idMess == null && other.idMess != null) || (this.idMess != null && !this.idMess.equals(other.idMess))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "domain.Messages[idMess=" + idMess + "]";
    }





}


